<!--企业考核人员维护-->
<template>
  <div class="page">
    <div class="top-search">
      <div class="top-search-item">
        <el-button type="primary">新增</el-button>
      </div>
      <div class="top-search-item">
        <el-button type="danger">删除</el-button>
      </div>
      <div class="top-search-item">
        <el-button type="success">保存</el-button>
      </div>
      <div class="top-search-item">
        <el-input placeholder="请输入专家姓名关键字" />
      </div>
      <div class="top-search-item">
        <el-button type="primary">检索</el-button>
      </div>
    </div>
    <div class="content">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column
          type="selection"
          width="55"
        />
        <el-table-column
          align="center"
          label="姓名"
        >
          <template slot-scope="scope">
            <div class="text-green" @click="nameHandleClick(scope.row)">
              {{ scope.row.name }}
            </div>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="企业名称"
        >
          <template slot-scope="scope">
            <div class="text-green" @click="comHandleClick(scope.row)">
              {{ scope.row.com }}
            </div>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="备注"
        />
      </el-table>
    </div>
    <div class="page">
      <el-pagination
        :current-page="currentPage"
        :page-size="20"
        layout="total, prev, pager, next, jumper"
        :total="0"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </div>

    <el-dialog
      title="提示"
      :visible.sync="dialogVisible1"
      width="30%"
    >
      <div class="top-search">
        <div class="top-search-item">
          <el-button type="primary">确定</el-button>
        </div>
        <div class="top-search-item">
          <el-button type="info">取消</el-button>
        </div>
        <div class="top-search-item">
          <el-input placeholder="请输入专家姓名关键字" />
        </div>
        <div class="top-search-item">
          <el-button type="primary">检索</el-button>
        </div>
      </div>
      <div class="content-dialog">
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%"
          @selection-change="handleSelectionChange"
        >
          <el-table-column
            type="selection"
            width="55"
          />
          <el-table-column
            align="center"
            label="姓名"
          />
          <el-table-column
            align="center"
            label="备注"
          />
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible1 = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible1 = false">确 定</el-button>
      </span>
    </el-dialog>

    <el-dialog
      title="提示"
      :visible.sync="dialogVisible2"
      width="30%"
    >
      <div class="top-search">
        <div class="top-search-item">
          <el-button type="primary">确定</el-button>
        </div>
        <div class="top-search-item">
          <el-button type="info">取消</el-button>
        </div>
        <div class="top-search-item">
          <el-input placeholder="请输入专家姓名关键字" />
        </div>
        <div class="top-search-item">
          <el-button type="primary">检索</el-button>
        </div>
      </div>
      <div class="content-dialog">
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%"
          @selection-change="handleSelectionChange"
        >
          <el-table-column
            type="selection"
            width="55"
          />
          <el-table-column
            align="center"
            label="企业名称"
          />
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible2 = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible2 = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          name: '张三',
          com: 'XXX'
        }
      ],
      multipleSelection: [],
      currentPage: 1,
      dialogVisible1: false,
      dialogVisible2: false
    }
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    nameHandleClick() {
      this.dialogVisible1 = true
    },
    comHandleClick() {
      this.dialogVisible2 = true
    }
  }
}
</script>

<style lang="scss" scoped>
.page {
  padding: 1rem;

  .top-search {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;

    .top-search-item {
      margin-right: 1rem;
    }
  }

  .content {
    margin-top: 2rem;
    width: 100%;
    height: 40rem;
  }
  .content-dialog {
    margin-top: 2rem;
    width: 100%;
    height: 20rem;
  }
}

.text-green {
  color: #67C23A;
  cursor: pointer;
}
</style>
